<?php
class Email_model extends CI_Model
{
	//sent email function
	public function send_email($send_to, $subject, $message)
	{
		$config = array(
			'protocol' => 'smtp',
			'smtp_host' => 'ssl://smtp.googlemail.com',
			'smtp_port' => '465',
			'smtp_user' => 'project02psuphuket@gmail.com',
			'smtp_pass' => 'project02psuphuket',
			'mailtype' => 'html'
		);
		
		$this->load->library('email', $config);
		$this->email->set_newline("\r\n");
		
		$this->email->from('project02psuphuket@gmail.com', 'admin@project02');
		$this->email->to($send_to);
		$this->email->subject($subject);
		$this->email->message($message);
		
		if($this->email->send())
		{
			return true;
		}
		else {
			return false;
		}
		
	}
}